home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ULTFORM.ZIP / ULTFORM.TXT
Text File  |  1993-08-17  |  8KB  |  179 lines

  1.  
  2.                Mysterious's ULTRA TRACKER File Format
  3.                   by FreeJack of The Elven Nation
  4.  
  5. I've done my best to document the file format of Ultra Tracker (UT).
  6. If you find any errors please contact me.
  7. The file format has stayed consistent through the first four public releases.
  8. At the time of this writting, UltraTracker is up to version 1.3
  9.  
  10. Thanks go to :
  11. SoJa of YLYSY for help translating stuff.
  12.  
  13. Marc Andre Schallehn
  14. Thanks for putting out this GREAT program.
  15. Also thanks for the info on 16bit samples.
  16.  
  17. With all this crap out of the way lets get to the format.
  18.  
  19.  
  20. Sample Structure : 
  21. ______________________________________________________________________________
  22. Samplename : 32 bytes (Sample name)
  23. DosName    : 12 bytes (when you load a sample into UT,
  24.                       it records the file name here)
  25. LoopStart  : dbl word (loop start point)
  26. LoopEnd    : dbl word (loop end point)
  27. SizeStart  : dbl word (see below)
  28. SizeEnd    : dbl word (see below)
  29. volume     : byte (UT uses a logarithmic volume setting, ranging from 0-255)
  30. Bidi Loop  : byte (see below)
  31. FineTune   : word (Fine tune setting, uses full word value)
  32. ______________________________________________________________________________
  33.  
  34. 8 Bit Samples :
  35.  
  36. SizeStart  :
  37. The SizeStart is the starting offset of the sample. 
  38. This seems to tell UT how to load the sample into the Gus's onboard memory. 
  39. All the files I have worked with start with a value of 32 for the first sample, 
  40. and the previous SizeEnd value for all sample after that. (See Example below)
  41. If the previous sample was 16bit, then SizeStart = (Last SizeEnd * 2)
  42. SizeEnd : 
  43. Like the SizeStart, SizeEnd seems to tell UT where to load the sample into the 
  44. Gus's onboard memory. SizeEnd equal SizeStart + the length of the sample.
  45.  
  46. Example :
  47. If a UT file had 3 samples, 1st 12000 bytes, 2nd 5600  bytes, 3rd 8000 byte. 
  48. The SizeStart and SizeEnd would look like this:
  49.  
  50. Sample        SizeStart         SizeEnd
  51. 1st            32                12032
  52. 2nd            12032             17632
  53. 3rd            17632             25632
  54.  
  55. ***Note***
  56. Samples may NOT cross 256k boundaries. If a sample is too large to fit into the
  57. remaining space, its Sizestart will equal the start of the next 256k boundary.
  58. UT does keep track of the free space at the top of the 256k boundaries, and
  59. will load a sample in there if it will fit.
  60. Example : EndSize = 252144
  61. If the next sample was 12000 bytes, its SizeStart would be 262144, not 252144.
  62. Note that this leaves 10000 bytes unused. If any of the following sample could
  63. fit between 252144 and 262144, its Sizestart would be 252144.
  64. Say that 2 samples after the 12000 byte sample we had a sample that was only
  65. 5000 bytes long. Its SizeStart would be 252144 and its SizeEnd would be 257144.
  66. This also applies to 16 Bit Samples.
  67.  
  68. 16 Bit Samples :
  69. 16 bit samples are handled a little different then 8 bit samples.
  70. The SizeStart variable is calculated by dividing offset (last SizeEnd)
  71. by 2. The SizeEnd variable equals SizeStart + (SampleLength / 2).
  72. If the first sample is 16bit, then SizeStart = 16.
  73. Example :
  74.           sample1 = 8bit, 1000 bytes
  75.           sample2 = 16bit, 5000 bytes
  76.  
  77.           sample1 SizeStart = 32
  78.                   SizeEnd   = 1032 (32 + 1000)
  79.  
  80.           sample2 SizeStart = 516 (offset (1032) / 2)
  81.                   SizeEnd   = 3016 (516 + (5000/2))
  82.  
  83. ***Note***
  84. If a 16bit sample is loaded into banks 2,3, or 4
  85. the SizeStart variable will be
  86. (offset / 2) + 262144 (bank 2)
  87. (offset / 2) + 524288 (bank 3)
  88. (offset / 2) + 786432 (bank 4)
  89. The SizeEnd variable will be
  90. SizeStart + (SampleLength / 2) + 262144 (bank 2)
  91. SizeStart + (SampleLength / 2) + 524288 (bank 3)
  92. SizeStart + (SampleLength / 2) + 786432 (bank 4)
  93.  
  94. BiDi Loop : (Bidirectional Loop)
  95. UT takes advantage of the Gus's ability to loop a sample in several different
  96. ways. By setting the Bidi Loop, the sample can be played forward or backwards,
  97. looped or not looped. The Bidi variable also tracks the sample
  98. resolution (8 or 16 bit).
  99.  
  100. The following table shows the possible values of the Bidi Loop.
  101. Bidi = 0  : No looping, forward playback,  8bit sample
  102. Bidi = 4  : No Looping, forward playback, 16bit sample
  103. Bidi = 8  : Loop Sample, forward playback, 8bit sample
  104. Bidi = 12 : Loop Sample, forward playback, 16bit sample
  105. Bidi = 24 : Loop Sample, reverse playback 8bit sample
  106. Bidi = 28 : Loop Sample, reverse playback, 16bit sample
  107. _________________________________________________________________________________________
  108. Event Structure:
  109. _________________________________________________________________________________________
  110. Note                : byte (See note table below)
  111. SampleNumber        : byte (Sample Number)
  112. Effect1             : nib (Effect1)
  113. Effect2             : nib (Effect2)
  114. EffectVar           : word (Effect variables)
  115.  
  116. The High order byte of EffectVar is the Effect variable for Effect1.
  117. The Low order byte of EffectVar is the Effect variable for Effect2.
  118. ***(Note)***
  119. UT uses a form of compression on repetitive events. Say we read in the first
  120. byte, if it = $FC then this signifies a repeat block. The next byte is the
  121. repeat count. followed by the event structure to repeat.
  122. If the first byte read does NOT = $FC then this is the note of the event.
  123. So repeat blocks will be 7 bytes long : RepFlag      : byte ($FC)
  124.                                         RepCount     : byte
  125.                                         note         : byte
  126.                                         samplenumber : byte
  127.                                         effect1      : nib
  128.                                         effect2      : nib
  129.                                         effectVar    : word
  130.  
  131. Repeat blocks do NOT bridge patterns. 
  132. _______________________________________________________________________________________________
  133. Note Table:
  134. _______________________________________________________________________________________________
  135. note value of 0 = pause
  136. C-0 to B-0    1 to 12
  137. C-1 to B-1    13 to 24
  138. C-2 to B-2    26 to 36
  139. C-3 to B-3    39 to 48
  140. C-4 to B-4    52 to 60
  141. ________________________________________________________________________________________________
  142. Offset     Bytes            Type                   Description
  143. ________________________________________________________________________________________________
  144. 0             15           byte           ID block : should contain
  145.                                                      'MAS_UTrack_V001'
  146.  
  147. 15            32           AsciiZ         Song Title
  148. 47            1            reserved       This byte is reserved and
  149.                                           always contain 0;
  150.  
  151. 48            1            byte           Number of Samples (NOS)
  152. 49            NOS * 64     SampleStruct   Sample Struct (see Sample Structure)
  153.  
  154. Patt_Seq = 48 + (NOS * 64)
  155.                        
  156. Patt_Seq          256        byte            Pattern Sequence
  157. Patt_Seq+256      1          byte            Number Of Channels (NOC) Base 0
  158. Patt_Seq+257      1          byte            Number Of patterns (NOP) Base 0
  159.  
  160. Patt_Seq+258      varies     EventStruct     Pattern Data (See Event Structure)
  161.  
  162. ___________________________________________________________________________
  163. The remainder of the file is the raw sample data.
  164. ___________________________________________________________________________
  165.  
  166. That should about cover it. If you have any questions , feel free
  167. to e-mail me at
  168. freejack@shell.portal.com
  169.  
  170. I can also be contacted on The UltraSound Connection   (813) 787-8644 
  171. The UltraSound Connection is a BBS dedicated to the Gravis Ultrasound Card.
  172.  
  173. Also I'm the author of Ripper and Gvoc. If anyone has any questions or problems,
  174. please contact me.
  175.  
  176.  
  177.  
  178.  
  179.